<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.cjs.prod.min.js"></script>
    <style>
        .back{
            background-color: brown;
        }
    </style>
    
</head>
<body>
    <div id="app">
        <ul>
            <li v-for='(item,index) in arr'>
                <div @click='assBack(index)'>
                    {{item.name}}{{index}}
                </div>
            </li>
        </ul>
    </div>
    <script src="js1.js">
        new Vue({
            el:'#app'
            data(){
                return{
                    arr:[{
                        id:1,
                        name:'html'
                    },{
                        id:2,
                        name:'css'
                    },{
                        id:3,
                        name:'js'
                    }]
                }
        }
        methods:{
            assBack(index){
                // console.log(222)

            }
        }
        })
        
    </script>
</body>
</html>